#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
import time
import threading

def run():
    print(threading.current_thread().getName())
    time.sleep(2)
    print("子线程工作完毕")

for i in range(3):
    t = threading.Thread(target=run,)
    t.setDaemon(True)    # 后台进程， 守护进程
    t.start()

time.sleep(1)
print("主线程结束")
print(threading.active_count())